package com.numbfish.ch61_ex03_module_b;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

@SpringBootApplication
public class Ch61Ex03ModuleBApp {
    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(Ch61Ex03ModuleBApp.class, args);
        ConfigurableEnvironment environment = applicationContext.getEnvironment();
        while (true) {
            // String value = environment.getProperty("spring.datasource.driver-class-name");
            String value = environment.getProperty("spring.datasource.password");
            System.out.println(value);
            Thread.sleep(2000);
        }
    }
}